﻿package com.gengine.resource.loader
{
    import flash.utils.*;

    public class DataLoader extends BaseLoader
    {
        private var _data:ByteArray = null;

        public function DataLoader()
        {
            return;
        }// end function

        override public function getClass() : Class
        {
            return DataLoader;
        }// end function

        public function get bytesData() : ByteArray
        {
            return this._data;
        }// end function

        override public function initialize(param1) : void
        {
            if (!(param1 is ByteArray))
            {
                throw new Error("DataResource can only handle ByteArrays.");
            }
            this._data = param1;
            if (resourceInfo)
            {
                resourceInfo.data = this._data;
            }
            onLoadCompleteHandler();
            return;
        }// end function

        override protected function onContentReady(param1) : Boolean
        {
            return this._data != null;
        }// end function

    }
}
